local skel = fk.CreateSkill {
  name = "rmt__gonglao",
  tags = {Skill.Compulsory},
}

Fk:loadTranslationTable{
  ["rmt__gonglao"] = "共老",
  [":rmt__gonglao"] = "锁定技，其他角色于你出牌阶段展示手牌时，你也须展示手牌，若使展示牌中存在的点数连续牌数增多，你与其各摸两张牌。",

  ["$rmt__gonglao1"] = "梦见邺城旧邸，君耕原上田，妾饲檐下蚕…",
  ["$rmt__gonglao2"] = "天家金枝，终不似荆钗布裙，为君怀丝缀旧衫。",
}

skel:addEffect(fk.CardShown, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skel.name, true) and player.phase == Player.Play and target and target ~= player
    and not player:isKongcheng()
    and table.find(data.cardIds, function(id) return table.contains(target:getCardIds("h"), id) end)
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local show = table.filter(data.cardIds, function(id) return table.contains(target:getCardIds("h"), id) end)
    local nums, continuous = {}, {}
    for _, id in ipairs(show) do
      table.insertIfNeed(nums, Fk:getCardById(id).number)
    end
    table.sort(nums)
    for _, num in ipairs(nums) do
      if table.contains(nums, num + 1) then
        table.insertIfNeed(continuous, num)
        table.insertIfNeed(continuous, num + 1)
      end
    end
    local hand = player:getCardIds("h")
    if #hand == 0 then return end
    player:showCards(hand)
    if player.dead and target.dead then return end
    for _, id in ipairs(hand) do
      table.insertIfNeed(nums, Fk:getCardById(id).number)
    end
    table.sort(nums)
    local new_continuous = {}
    for _, num in ipairs(nums) do
      if table.contains(nums, num + 1) then
        table.insertIfNeed(new_continuous, num)
        table.insertIfNeed(new_continuous, num + 1)
      end
    end
    if #new_continuous > #continuous then
      room:delay(800)
      if player:isAlive() then
        player:drawCards(2, skel.name)
      end
      if target:isAlive() then
        target:drawCards(2, skel.name)
      end
    end
  end,
})




return skel
